cmake_minimum_required(VERSION 3.10)
project(safetyboard)

# set(ENABLE_SCB 2)
set(ENABLE_PSCB 3)
# set(ENABLE_GSCB 4)
set(ENABLE_HSCB 5)
set(ENABLE_HUBSCB 6)


if(ENABLE_HSCB)
# HSCB is for max cabinet
add_definitions(-DENABLE_HSCB)
aux_source_directory(./hscb HSCB_SRCS)
message(STATUS "HSCB: enable")
else()
message(STATUS "HSCB: disable")
endif()

if(ENABLE_GSCB)
# GSCB is for cabv3
add_definitions(-DENABLE_GSCB)
aux_source_directory(./gscb GSCB_SRCS)
message(STATUS "GSCB: enable")
else()
message(STATUS "GSCB: disable")
endif()

if(ENABLE_HUBSCB)
# for robohub
add_definitions(-DENABLE_HUBSCB)
aux_source_directory(./robohubscb ROBHUB_SRCS)
message(STATUS "HUBSCB: enable")
else()
message(STATUS "HUBSCB: disable")
endif()

if(ENABLE_SCB)
# for cabv2
add_definitions(-DENABLE_SCB)
aux_source_directory(./scb SCB_SRCS)
message(STATUS "SCB: enable")
else()
message(STATUS "SCB: disable")
endif()

if(ENABLE_PSCB)
# for minicab
add_definitions(-DENABLE_PSCB)
aux_source_directory(./pscb PSCB_SRCS)
message(STATUS "PSCB: enable")
else()
message(STATUS "PSCB: disable")
endif()


aux_source_directory(. SRC)

add_library(${PROJECT_NAME} 
scbitf.cc
powerdev.cc
${SRC}
${SCB_SRCS}
${PSCB_SRCS}
${HSCB_SRCS}
${GSCB_SRCS}
${ROBHUB_SRCS}
)

add_subdirectory(test)